namespace RenameX.Rules
{
    public class DeleteCharsRule : RuleBase
    {
        public override string Name => "删除字符";

        public int StartIndex { get; set; } = 0; // 0-based
        public int Count { get; set; } = 1;

        public override string Apply(string originalName)
        {
            if (StartIndex < 0 || Count <= 0 || StartIndex >= originalName.Length) return originalName;
            var maxCount = originalName.Length - StartIndex;
            var c = Count > maxCount ? maxCount : Count;
            return originalName.Remove(StartIndex, c);
        }
    }
}


